package com.gitee.xhs.savePointReader.keyedState.mapStateReader;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * @author BigHead
 * @date 2022/6/30 16:39
 * @description MapStateExhibitor
 */
public class MapStateExhibitor {

    private String jobId;

    private String operatorUid;

    private Long key;

    private Map<Integer, Double> mapStateValue;

    public String getJobId() {
        return jobId;
    }

    public void setJobId(String jobId) {
        this.jobId = jobId;
    }

    public String getOperatorUid() {
        return operatorUid;
    }

    public void setOperatorUid(String operatorUid) {
        this.operatorUid = operatorUid;
    }

    public Long getKey() {
        return key;
    }

    public void setKey(Long key) {
        this.key = key;
    }

    public Map<Integer, Double> getMapStateValue() {
        return mapStateValue;
    }

    public void setMapStateValue(Map<Integer, Double> mapStateValue) {
        this.mapStateValue = mapStateValue;
    }


    @Override
    public String toString() {
        List<String> toStringList = new ArrayList<>();
        for (Map.Entry<Integer, Double> mapEntry : mapStateValue.entrySet()) {
            toStringList.add(
                    "生成次序: " + mapEntry.getKey() + ", 值: " + mapEntry.getValue()
            );
        }
        return "MapStateExhibitor{" +
                "jobId='" + jobId + '\'' +
                ", operatorUid='" + operatorUid + '\'' +
                ", key=" + key +
                ", mapStateValue='" + String.join("|", toStringList) + "'" +
                '}';
    }
}
